package com.zll.exam;

import java.util.*;

public class Test2 {
    static int num;
    static int[] nums;
    static int k;
    static int target;
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()){
            num = 0;
            String numStr = scan.nextLine();
            String[] numsStr = numStr.split(" ");
            nums = new int[numsStr.length];
            for (int i = 0; i < numsStr.length; i++) {
                nums[i] = Integer.parseInt(numsStr[i]);
            }
            k = scan.nextInt();
            target = scan.nextInt();

            Arrays.sort(nums);
            check(0, 0, 0);
            System.out.println(num);
        }
    }

    public static void check(int start, int totalNum, int totalValue){
        if(totalNum == k){
            if(totalValue==target){
                num++;
            }
            return;
        }

        for(int i=start;i<nums.length;i++){
            totalValue = totalValue + nums[i];
            if(totalValue>target){
                return;
            }
            totalNum++;
            check(start+1,totalNum,totalValue);
            totalValue = totalValue - nums[i];
            totalNum--;
        }
    }
}
